package com.tarena.lbs.basic.web.assemble;

import com.alibaba.fastjson2.JSON;


import com.alibaba.fastjson2.TypeReference;
import com.tarena.lbs.pojo.basic.vo.ArticleItemTag;
import com.tarena.lbs.pojo.basic.vo.UserItemTag;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class TagAssembler {
    public Map<String, List<ArticleItemTag>> assembleArticleTags(){
        String tagsJson="{\n" +
                "  \"电影\": [\n" +
                "    {\n" +
                "      \"tagCategoryName\": \"电影\",\n" +
                "      \"tagLibraryBO\": {\n" +
                "        \"id\": 43,\n" +
                "        \"tagType\": 93,\n" +
                "        \"tagTypeName\": null,\n" +
                "        \"tagName\": \"剧情\",\n" +
                "        \"tagCategory\": 103,\n" +
                "        \"tagCategoryName\": null,\n" +
                "        \"coding\": \"ba28bd9d-3655-4f18-1041-bc1c1f932b4c\",\n" +
                "        \"status\": 0,\n" +
                "        \"usageCount\": 0,\n" +
                "        \"tagDesc\": \"剧情推进\",\n" +
                "        \"visibisity\": 0,\n" +
                "        \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"userSelected\": null\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"tagCategoryName\": \"电影\",\n" +
                "      \"tagLibraryBO\": {\n" +
                "        \"id\": 44,\n" +
                "        \"tagType\": 93,\n" +
                "        \"tagTypeName\": null,\n" +
                "        \"tagName\": \"喜剧\",\n" +
                "        \"tagCategory\": 103,\n" +
                "        \"tagCategoryName\": null,\n" +
                "        \"coding\": \"ba28bd9d-3655-4f18-1041-bc1c1f932b4c\",\n" +
                "        \"status\": 0,\n" +
                "        \"usageCount\": 0,\n" +
                "        \"tagDesc\": \"喜剧电影\",\n" +
                "        \"visibisity\": 0,\n" +
                "        \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"userSelected\": null\n" +
                "      }\n" +
                "    }\n" +
                "  ],\n" +
                "  \"游记\": [\n" +
                "    {\n" +
                "      \"tagCategoryName\": \"游记\",\n" +
                "      \"tagLibraryBO\": {\n" +
                "        \"id\": 40,\n" +
                "        \"tagType\": 93,\n" +
                "        \"tagTypeName\": null,\n" +
                "        \"tagName\": \"日记\",\n" +
                "        \"tagCategory\": 102,\n" +
                "        \"tagCategoryName\": null,\n" +
                "        \"coding\": \"f90af398-f7f7-4ef2-bd2b-90a056bce8de\",\n" +
                "        \"status\": 0,\n" +
                "        \"usageCount\": 0,\n" +
                "        \"tagDesc\": \"旅行日记\",\n" +
                "        \"visibisity\": 0,\n" +
                "        \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"userSelected\": null\n" +
                "      }\n" +
                "    },\n" +
                "    {\n" +
                "      \"tagCategoryName\": \"游记\",\n" +
                "      \"tagLibraryBO\": {\n" +
                "        \"id\": 41,\n" +
                "        \"tagType\": 93,\n" +
                "        \"tagTypeName\": null,\n" +
                "        \"tagName\": \"趣闻\",\n" +
                "        \"tagCategory\": 102,\n" +
                "        \"tagCategoryName\": null,\n" +
                "        \"coding\": \"ba28bd9d-3655-4f18-9041-bc1c1f932b4c\",\n" +
                "        \"status\": 0,\n" +
                "        \"usageCount\": 0,\n" +
                "        \"tagDesc\": \"趣闻轶事\",\n" +
                "        \"visibisity\": 0,\n" +
                "        \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "        \"userSelected\": null\n" +
                "      }\n" +
                "    }\n" +
                "  ]\n" +
                "}";
        TypeReference<Map<String, List<ArticleItemTag>>>
                targetTypeReference=new TypeReference<Map<String, List<ArticleItemTag>>>() {};
        Map<String,List<ArticleItemTag>> resultMap = JSON.parseObject(tagsJson, targetTypeReference);
        return resultMap;
    }

    public Map<String,List<UserItemTag>> assembleUserTags(){
        String userTagJson="{\n" +
                "    \"旅行探险\": [\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"旅行探险\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 2,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"国内游爱好者\",\n" +
                "                \"tagCategory\": 91,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"c03dd897-9094-4c8d-8b85-1039404f62a6\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"国内游爱好者\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"旅行探险\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 6,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"境外旅行达人\",\n" +
                "                \"tagCategory\": 91,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"a4ee63e6-95d8-4233-970c-dce7ae606b43\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"境外旅行达人\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"旅行探险\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 30,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"探险旅行家\",\n" +
                "                \"tagCategory\": 91,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"32539216-e467-4150-9944-5b14b065787a\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"探险旅行家\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        }\n" +
                "    ],\n" +
                "    \"阅读\": [\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"阅读\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 7,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"小说\",\n" +
                "                \"tagCategory\": 90,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"0cccd1a7-f68e-46b2-9e56-c543b4a8e02d\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"小说\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"阅读\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 37,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"历史书籍\",\n" +
                "                \"tagCategory\": 90,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"93d90492-7d7c-4487-aa40-b4d36e68248f\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"历史书籍\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        }\n" +
                "    ],\n" +
                "    \"美食探索\": [\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"美食探索\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 3,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"美食博主\",\n" +
                "                \"tagCategory\": 89,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"eedf7560-eff5-4ef8-bacf-062a7b42d20b\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"美食博主\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"美食探索\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 26,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"甜品控\",\n" +
                "                \"tagCategory\": 89,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"136012ee-636d-4383-8515-9a9e63d58619\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"甜品控\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"美食探索\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 27,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"川菜迷\",\n" +
                "                \"tagCategory\": 89,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"2d4e29f2-f781-4b2a-a7c6-0249bd8b9445\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"川菜迷\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        }\n" +
                "    ],\n" +
                "    \"运动\": [\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"运动\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 9,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"跑步\",\n" +
                "                \"tagCategory\": 98,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"7c4c4036-92a1-4df0-9784-bc1d0a1ca402\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"北京\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"运动\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 33,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"瑜伽\",\n" +
                "                \"tagCategory\": 98,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"7d849602-a23a-4744-85ec-d23da684fba8\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"瑜伽\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"运动\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 34,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"篮球\",\n" +
                "                \"tagCategory\": 98,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"c9e846ab-cf32-4510-9d88-489c12f423fc\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"篮球\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        }\n" +
                "    ],\n" +
                "    \"趣闻\": [\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"趣闻\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 1,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"流行音乐迷\",\n" +
                "                \"tagCategory\": 99,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"db65b7e3-79e9-48f5-beba-eea2ec3f9357\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"流行音乐迷\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"趣闻\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 21,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"游乐场游玩\",\n" +
                "                \"tagCategory\": 99,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"54096467-1273-44a9-9f6c-544a17f38917\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"游乐场游玩\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        },\n" +
                "        {\n" +
                "            \"tagCategoryName\": \"趣闻\",\n" +
                "            \"tagLibraryBO\": {\n" +
                "                \"id\": 22,\n" +
                "                \"tagType\": 92,\n" +
                "                \"tagTypeName\": null,\n" +
                "                \"tagName\": \"古典音乐爱好者\",\n" +
                "                \"tagCategory\": 99,\n" +
                "                \"tagCategoryName\": null,\n" +
                "                \"coding\": \"f3661ca2-b6c2-493e-aa59-aeb253043118\",\n" +
                "                \"status\": 0,\n" +
                "                \"usageCount\": 0,\n" +
                "                \"tagDesc\": \"古典音乐爱好者\",\n" +
                "                \"visibisity\": 0,\n" +
                "                \"createAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"updateAt\": \"2023-12-03 16:00:00\",\n" +
                "                \"userSelected\": false\n" +
                "            }\n" +
                "        }\n" +
                "    ]\n" +
                "}";
        TypeReference<Map<String, List<UserItemTag>>>
                targetTypeReference=new TypeReference<Map<String, List<UserItemTag>>>() {};
        Map<String,List<UserItemTag>> resultMap = JSON.parseObject(userTagJson, targetTypeReference);
        return resultMap;
    }
}
